<?php

namespace app\http\middleware;

class Check
{
    //第三个参数,可以通过路由赋值传递
    public function handle($request, \Closure $next,$name)
    {
        //下面这一句是给控制器传值
        $request->hello = 'ThinkPHP';
        if ($name == 'think'){
            return redirect('index/think');
        }
        return $next($request);
    }
}
